From: Marco Trevisan (TreviƱo) Date: Wed, 6 Jul 2022 15:47:14 +0000 (+0200) Subject: signalTracker: Avoid creating a temporary keys array when clearing X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~275 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=74720f250e51f9f7ae65b9be18cfde53b7103ae9;p=gnome-shell.git signalTracker: Avoid creating a temporary keys array when clearing We used to create a temporary array of signal tracker keys and then to iterate through them in order to untrack the objects, but the Map's can be iterated directly so let's just use their native forEach. Part-of: --- diff --git a/js/misc/signalTracker.js b/js/misc/signalTracker.js index 30d19a27f..e01bec5b1 100644 --- a/js/misc/signalTracker.js +++ b/js/misc/signalTracker.js @@ -138,7 +138,7 @@ class SignalTracker { * @returns {void} */ clear() { - [...this._map.keys()].forEach(obj => this.untrack(obj)); + this._map.forEach((_, obj) => this.untrack(obj)); } /**